package com.guige.convert.producer;

import com.guige.base.constant.Constant;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Component;

/**
 * 交易流水生产者
 *
 * @author songaw
 * @date 2018/5/11 17:05
 */
@Component
@Slf4j
public class ConvertProducer {
    @Autowired
    private KafkaTemplate<String, String> kafkaTemplate;

    public void sendConvertMsg(String message) {
        try {
            kafkaTemplate.send(Constant.KAFKA_CONVERT, message);

        } catch (Exception e) {
            log.error("发送失败", e);
        }

    }
}
